X-Git-Url: https://git.lxde.org/gitweb/?p=lxde%2Flxdm.git;a=blobdiff_plain;f=src%2Fgreeter.c;h=0e26b6d42e9ddb1d0d9069d3ae034f8485086668;hp=65c74550b88488f1ad2cabca273cabca0fd0376d;hb=cee37e0d27c07023cb08925330ae2db691e2429c;hpb=7ed5f86780a2de415b590b6ec5136e15b1fd888d

diff --git a/src/greeter.c b/src/greeter.c
index 65c7455..0e26b6d 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -70,6 +70,7 @@ static GtkWidget* user_list;
 static GtkWidget* sessions;
 static GtkWidget* lang;
 
+static GtkWidget* onscreenkeyboard_btn;
 static GtkWidget* exit_btn;
 
 static GtkWidget* exit_menu;
@@ -81,6 +82,8 @@ static char* pass = NULL;
 static char* ui_file = NULL;
 static char *ui_nobody = NULL;
 
+static char* onscreenkeyboard_cmd = NULL;
+
 static GIOChannel *greeter_io;
 
 static int auto_login;
@@ -720,6 +723,15 @@ static void on_exit_clicked(GtkButton* exit_btn, gpointer user_data)
                    0, gtk_get_current_event_time() );
 }
 
+static void on_screenkeyboard_clicked(GtkButton* screenkeyboard_btn, 
+                                      gpointer user_data)
+{
+	gboolean res;
+	/* set the current xkb */
+	res=g_spawn_command_line_async(onscreenkeyboard_cmd, NULL);
+	printf("spawn onscreenkeyboard: %s %d\n", onscreenkeyboard_cmd, res);
+}
+
 static void load_exit()
 {
     GtkWidget* item;
@@ -1248,6 +1260,21 @@ static void create_win()
 		load_exit();
     }
 
+	onscreenkeyboard_btn = (GtkWidget*)gtk_builder_get_object(builder, "onscreenkeyboard");
+	onscreenkeyboard_cmd = g_key_file_get_string(config, "display", "onscreenkeyboard",NULL);
+
+    if(onscreenkeyboard_cmd && onscreenkeyboard_cmd[0])
+    {
+        gtk_widget_show(onscreenkeyboard_btn);
+	    g_signal_connect(onscreenkeyboard_btn, "clicked", G_CALLBACK(on_screenkeyboard_clicked), NULL);
+    }
+    else
+    {
+		if (onscreenkeyboard_btn != NULL) {
+			gtk_widget_hide(onscreenkeyboard_btn);
+		}
+    }
+
 	ui_get_geometry(window,&rc);
 	gtk_window_move(GTK_WINDOW(win),rc.x,rc.y);
 	gtk_window_set_default_size(GTK_WINDOW(win),rc.width,rc.height);

